package server

import (
	"gitee.com/lailonghui/vehicle-supervision-framework/pkg/services"
	"google.golang.org/grpc"
)

// 获取默认的grpc 配置
func DefaultOptions() []grpc.DialOption {
	return []grpc.DialOption{grpc.WithInsecure()}
}

// 获取默认的grpc 配置
func DefaultClientOptions() []grpc.DialOption {
	return []grpc.DialOption{grpc.WithInsecure()}
}

// 获取默认的grpc 配置
func ClientOptionsByConfig(c *services.EndpointConfig) []grpc.DialOption {
	options := []grpc.DialOption{grpc.WithInsecure()}

	if c == nil {
		return options
	}
	if c.Timeout != nil {
		options = append(options, grpc.WithTimeout(*c.Timeout))
	}

	return []grpc.DialOption{grpc.WithInsecure()}
}

func ClientAuthorizationOption() grpc.DialOption {

	return nil
}
